﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
    public class Dog
    {
        private string name;
        private Host owner;
        public Host Owner
        {
            get{return this.owner;}
    set{
        this.owner=value;
        this.owner.OnGetup += new EventHandler(owner_OnGetup);
       }
        }
        public Dog(string name)
        {
            this.name = name;
        }
        private void owner_OnGetup(object sender,EventArgs e)
        {
            Console.WriteLine("{0}",name);
            Console.WriteLine("汪汪汪...主人起床了，我也该起了");
        }
     }  
}
